package org.easy.tool.controller;

import org.easy.tool.common.R;
import org.easy.tool.service.IKnowledge;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.LinkedHashMap;

/**
 *  标签
 *
 * @author Valley
 * @since 2024-09-04 22:51:14
 */
@RestController
@RequestMapping("/knowledge")
public class KnowledgeController {

    @Autowired
    IKnowledge service;

    @RequestMapping("submitKnowledge")
    public R submitKnowledge(@RequestBody(required = false)LinkedHashMap data) throws Exception {
        return R.ok(service.submitKnowledge(data));
    }

    @RequestMapping("getKnowledgeList")
    public R getKnowledgeList(@RequestBody(required = false)LinkedHashMap data) throws Exception {
        return R.ok(service.getKnowledgeList(data));
    }

    @RequestMapping("getKnowledgeNameList")
    public R getKnowledgeNameList(@RequestBody(required = false)LinkedHashMap data) throws Exception {
        return R.ok(service.getKnowledgeNameList(data));
    }

    @RequestMapping("getKnowledgeById")
    public R getKnowledgeById(@RequestBody(required = false)LinkedHashMap data) throws Exception {
        return R.ok(service.getKnowledgeById(data));
    }

    @RequestMapping("getKnowledgeByPid")
    public R getKnowledgeByPid(@RequestBody(required = false)LinkedHashMap data) throws Exception {
        return R.ok(service.getKnowledgeByPid(data));
    }

    @RequestMapping("sortKnowledge")
    public R sortKnowledge(@RequestBody(required = false)LinkedHashMap data) throws Exception {
        return R.ok(service.sortKnowledge(data));
    }

    @RequestMapping("updateKnowledge")
    public R updateKnowledge(@RequestBody(required = false)LinkedHashMap data) throws Exception {
        return R.ok(service.updateKnowledge(data));
    }

    @RequestMapping("deleteKnowledge")
    public R deleteKnowledge(@RequestBody(required = false)LinkedHashMap data) throws Exception {
        return R.ok(service.deleteKnowledge(data));
    }

    @RequestMapping("hideKnowledge")
    public R hideKnowledge(@RequestBody(required = false)LinkedHashMap data) throws Exception {
        return R.ok(service.hideKnowledge(data));
    }

    @RequestMapping("restoreKnowledge")
    public R restoreKnowledge(@RequestBody(required = false)LinkedHashMap data) throws Exception {
        return R.ok(service.restoreKnowledge(data));
    }

}
